TypeScript emits constructor parameter types as metadata via emitDecoratorMetadata: true in tsconfig. NestJS reads this using the reflect-metadata package to determine what tokens to inject. It then looks up those tokens in the module's provider registry and resolves the dependency graph recursively before instantiating the class.
NestJS leverages TypeScript's metadata reflection system to automatically detect constructor dependencies. When a class is decorated with @Injectable(), TypeScript emits type metadata that NestJS reads at runtime.
TypeScript emits design:paramtypes metadata for decorated classes.
NestJS reads this metadata using Reflect.getMetadata().
Each type is used as a DI token to look up a registered provider.
The container resolves the full dependency graph before instantiating any class.